package com.hp.it.sonar.enumeration;

public class Priority {
	public static String idToString(int i) {
		String ret = "";
		switch (i) {
		case 1:
			ret = "BLOCKER";
		case 2:
			ret = "CRITICAL";
		case 3:
			ret = "MAJOR";
		case 4:
			ret = "MINOR";
		case 5:
			ret = "INFO";
		}
		return ret;
	}

	public static int StringToId(String priority) {
		if ("BLOCKER".equalsIgnoreCase(priority)) {
			return 1;
		} else if ("CRITICAL".equalsIgnoreCase(priority)) {
			return 2;
		} else if ("MAJOR".equalsIgnoreCase(priority)) {
			return 3;
		} else if ("MINOR".equalsIgnoreCase(priority)) {
			return 3;
		}
		else if ("INFO".equalsIgnoreCase(priority)) {
			return 3;
		}

		return 0;
	}
}
